package com.ruoyi.system.mapper;

import com.ruoyi.system.domain.CapitalAccount;
import com.ruoyi.system.domain.vo.CapitalAccountVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.ArrayList;
import java.util.List;

/**
 * @author : 王孟轩
 * @date : 2025/2/24 22:14
 * @description :
 **/
@Mapper
public interface CapitalAccountMapper {
    int CapitalAccountAdd(CapitalAccount capitalAccount);

    ArrayList<CapitalAccount> CapitalAccountList(CapitalAccount capitalAccount);


    int CapitalAccountUpdate(CapitalAccount capitalAccount);

    int CapitalAccountAddBatch(@Param("list")List<CapitalAccount> list);
    @Select("SELECT \n" +
            "    COUNT(*) AS account_count\n" +
            "FROM \n" +
            "    capital_account\n" +
            "WHERE \n" +
            "    account_sort = #{accountSort};")
    Long number(@Param("accountSort") int accountSort);


    ArrayList<CapitalAccount> getRecordByCodeOrName(
            @Param("accountCoding") String accountCoding, @Param("accountTitle") String accountTitle,
            @Param("accountSort")int accountSort);
}
